import request from '@/utils/request'

// 用户注册接口
export const userRegisterService = ({ username, password, repassword}) => {
    return request.post('/employee/add', { username, password, repassword})
}

// 用户登录接口
export const userLoginService = ({ account, password}) => {
    return request.post('/employee/login', {
        account,
        password
    })
}

// 获取用户信息接口
export const userGetUserInfoService = () => {
    return request.get('/my/userinfo')
}

// 更新用户信息
export const userUpdateService = (user) => {
    return request.put('/my/userinfo', user)
}

// 更新用户头像
export const userUpdateAvatarService = (avatar) => {
    return request.patch('/my/update/avatar', {avatar})
}

// 重置用户密码
export const userResetPwdService = (password) => {
    return request.patch('/my/updatepwd', password)
} 